﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using kxcxw.Data.Entities;
using System.Data.Entity.ModelConfiguration;
using System.ComponentModel.DataAnnotations;

namespace kxcxw.Data.Mapping
{
    public class VisitInfoMap : EntityTypeConfiguration<VisitInfo>
    {
        public VisitInfoMap()
        {
            HasKey(t => t.Id);

            Property(t => t.Id).HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);

            ToTable("VisitInfo");

            Property(t => t.InformationID).HasColumnName("InformationID");
            Property(t => t.VisitNum).HasColumnName("VisitNum");
            Property(t => t.LastVisitTime).HasColumnName("LastVisitTime");
            Property(t => t.UserId).HasColumnName("UserId");
            Property(t => t.UserAddrOrIp).HasColumnName("UserAddrOrIp");
        }
    }


    public class YearVisitInfoMap : EntityTypeConfiguration<YearVisitInfo>
    {
        public YearVisitInfoMap() {
            HasKey(t => t.Id);

            Property(t => t.Id).HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);

            ToTable("YearVisitInfo");

            Property(t => t.InformationID).HasColumnName("InformationID");
            Property(t => t.VisitNum).HasColumnName("VisitNum");
            Property(t => t.Year).HasColumnName("Year");
        }
    }

    public class MonthVisitInfoMap : EntityTypeConfiguration<MonthVisitInfo>
    {
        public MonthVisitInfoMap() {
            HasKey(t => t.Id);

            Property(t => t.Id).HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);

            ToTable("MonthVisitInfo");

            Property(t => t.InformationID).HasColumnName("InformationID");
            Property(t => t.VisitNum).HasColumnName("VisitNum");
            Property(t => t.YearMonth).HasColumnName("YearMonth");
        }
    }

    public class DayVisitInfoMap : EntityTypeConfiguration<DayVisitInfo> {
        public DayVisitInfoMap() {
            HasKey(t => t.Id);

            Property(t => t.Id).HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);

            ToTable("DayVisitInfo");

            Property(t => t.InformationID).HasColumnName("InformationID");
            Property(t => t.VisitNum).HasColumnName("VisitNum");
            Property(t => t.YearMonthDay).HasColumnName("YearMonthDay");
        }
    }


}
